def gen_func():
    yield 1
    yield 2
    yield 3


def func():
    return 1


def fib(index):
    if index <= 2:
        return 1
    else:
        return fib(index-1) + fib(index-2)


def fib1(index):
    re_list = []
    n, a, b = 0, 0, 1
    while n < index:
        re_list.append(b)
        a, b = b, a+b
        n += 1
    return re_list


def fib2(index):

    n, a, b = 0, 0, 1
    while n < index:
        yield b
        a, b = b, a+b
        n += 1


if __name__ == '__main__':
    # print(gen_func())
    # gen = gen_func()
    # fun = func()
    # for i in gen:
    #     print(i)

    print(fib1(10))